
    // multiIndex:[0,0],
    // multiArray:[['收入','支出'],["工资","兼职","理财","礼金","其他","餐饮","购物","日用","交通","蔬菜","水果","零食","运动","娱乐","通讯","服饰","美容","住房","居家","社交","旅行","数码","烟酒","医疗","学习","书籍","宠物","礼金","办公","维修","捐赠","快递"]],
   
    var type=[{
        "categoryId":0,
            "categoryName":"收入",
            "categoryType": 0 ,
            "depth":0
        },
        {   
            "categoryId":1,
            "categoryName":"支出",
            "categoryType": 1 ,
            "depth":0
        },
        // {
        //     "categoryId":1,
        //     "categoryName": "工资",
        //     "categoryType": 0,
        //     "depth":1
        // },
        {
            "categoryId":2,
            "categoryName": "兼职",
            "categoryType": 0,
            "depth":1
        },
        {
            "categoryId":3,
            "categoryName": "理财",
            "categoryType": 0,
            "depth":1
        },
        {
            "categoryId":4,
            "categoryName": "礼金",
            "categoryType":0,
            "depth":1
        },
        {
            "categoryId":5,
            "categoryName": "其他",
            "categoryType": 0,
            "depth":1
        },
        {
            "categoryId":6,
            "categoryName": "餐饮",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId":7,
            "categoryName": "购物",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId":8,
            "categoryName": "日用",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId":9,
            "categoryName": "交通",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId":10,
            "categoryName": "蔬菜",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId":11,
            "categoryName": "水果",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId":12,
            "categoryName": "零食",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId":13,
            "categoryName": "运动",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId":14,
            "categoryName": "娱乐",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 15,
            "categoryName": "通讯",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 16,
            "categoryName": "服饰",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 17,
            "categoryName": "美容",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 18,
            "categoryName": "住房",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId": 19,
            "categoryName": "居家",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 20,
            "categoryName": "社交",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 21,
            "categoryName": "旅行",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 22,
            "categoryName": "数码",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId": 23,
            "categoryName": "烟酒",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 24,
            "categoryName": "医疗",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 25,
            "categoryName": "学习",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 26,
            "categoryName": "书籍",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 27,
            "categoryName": "宠物",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 28,
            "categoryName": "礼金",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 29,
            "categoryName": "办公",
            "categoryType":1,
            "depth":1
        },
        {
            "categoryId": 30,
            "categoryName": "维修",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 31,
            "categoryName": "捐赠",
            "categoryType": 1,
            "depth":1
        },
        {
            "categoryId": 32,
            "categoryName": "快递",
            "categoryType": 1,
            "depth":1
        }
    ]
    //province=accountType
    //city=category
    //provinceCity=type
    function getAccountTypeList(){
        var array=[]
        for (var key in type){
            if(type[key].depth==0){
                array.push(type[key])
            }
        }
        return array
    }
    module.exports={
        getAccountTypeList:getAccountTypeList(),
        getCategoryListByAccount:function(accountType){
            var array=[]
            for (var key in type) {
                if (type[key].depth == 1 && type[key].parent_code == accountType) {
                  array.push(type[key])
                }
              }
              return array
        },
        type:type
    }